$.get(
  "http://chst.vip:1234/api/getinlanddiscount",
  {},
  (res) => {
    let html = "";
    $(res.result).each((i, item) => {
      html += `
      <li productid=${item.productId}>
      ${item.productImg}
      <h3>${item.productName}</h3>
      <h4>${item.productPrice}</h4>
      <h5>
        <span>${item.productFrom}</span>
        <span>${item.productTime}</span>
      </h5>
    </li>
         `;
    });
    $(".contenttop").html(html);
  },
  "json"
);

$(".contenttop").on("click", "li", function () {
  let productid = $(this).attr("productid");
  location.href = `./inlandproduct.html?productid=${productid}`;
});
